package com.ruoyi.cderp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cderp.mapper.TblProductStockLogMapper;
import com.ruoyi.cderp.domain.TblProductStockLog;
import com.ruoyi.cderp.service.ITblProductStockLogService;

/**
 * 商品库存变动记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-04
 */
@Service
public class TblProductStockLogServiceImpl implements ITblProductStockLogService 
{
    @Autowired
    private TblProductStockLogMapper tblProductStockLogMapper;

    /**
     * 查询商品库存变动记录
     * 
     * @param id 商品库存变动记录主键
     * @return 商品库存变动记录
     */
    @Override
    public TblProductStockLog selectTblProductStockLogById(String id)
    {
        return tblProductStockLogMapper.selectTblProductStockLogById(id);
    }

    /**
     * 查询商品库存变动记录列表
     * 
     * @param tblProductStockLog 商品库存变动记录
     * @return 商品库存变动记录
     */
    @Override
    public List<TblProductStockLog> selectTblProductStockLogList(TblProductStockLog tblProductStockLog)
    {
        return tblProductStockLogMapper.selectTblProductStockLogList(tblProductStockLog);
    }

    /**
     * 新增商品库存变动记录
     * 
     * @param tblProductStockLog 商品库存变动记录
     * @return 结果
     */
    @Override
    public int insertTblProductStockLog(TblProductStockLog tblProductStockLog)
    {
        tblProductStockLog.setCreateTime(DateUtils.getNowDate());
        return tblProductStockLogMapper.insertTblProductStockLog(tblProductStockLog);
    }

    /**
     * 修改商品库存变动记录
     * 
     * @param tblProductStockLog 商品库存变动记录
     * @return 结果
     */
    @Override
    public int updateTblProductStockLog(TblProductStockLog tblProductStockLog)
    {
        return tblProductStockLogMapper.updateTblProductStockLog(tblProductStockLog);
    }

    /**
     * 批量删除商品库存变动记录
     * 
     * @param ids 需要删除的商品库存变动记录主键
     * @return 结果
     */
    @Override
    public int deleteTblProductStockLogByIds(String[] ids)
    {
        return tblProductStockLogMapper.deleteTblProductStockLogByIds(ids);
    }

    /**
     * 删除商品库存变动记录信息
     * 
     * @param id 商品库存变动记录主键
     * @return 结果
     */
    @Override
    public int deleteTblProductStockLogById(String id)
    {
        return tblProductStockLogMapper.deleteTblProductStockLogById(id);
    }
}
